import request from '@/utils/request'

/**
 * @description: 企业管理获取
 * @param {*} params params参数
 * @return {*} promise
 */
export const enterpriseAPI = params => {
  return request.get('/park/enterprise', { params })
}

/**
 * @description: 所在行业获取
 * @param {*} 无 无参数
 * @return {*} promise
 */
export const getenterhangAPI = () => {
  return request.get('/park/industry')
}

/**
 * @description: 增加企业
 * @param {*} data 参数
 * @returns  promise
 */
export const AddenterAPI = data => {
  return request.post('/park/enterprise', data)
}

/**
 * @description: 回显编辑企业
 * @param {*} 路径参数
 * @returns  promise
 */
export const ChaenterAPI = id => {
  return request.get(`/park/enterprise/${id}`)
}

/**
 * @description: 编辑企业
 * @param {*} data 参数
 * @returns  promise
 */
export const EditenterAPI = data => {
  return request.put('/park/enterprise', data)
}

/**
 * @description: 删除企业
 * @param {*} id 参数
 * @returns  promise
 */
export const DeleteenterAPI = id => {
  return request.delete(`/park/enterprise/${id}`)
}

/**
 * @description: 获取楼宇下拉列表
 * @param {*} 无 参数
 * @returns  promise
 */
export const getrentbuildingAPI = () => {
  return request.get('/park/rent/building')
}

/**
 * @description: 添加/续租企业的租赁合同
 * @param {*} data 参数
 * @returns  promise
 */
export const AddEditenterAPI = data => {
  return request.post('/park/enterprise/rent', data)
}

/**
 * @description: 企业租赁信息展开
 * @param {*} id 参数
 * @returns  promise
 */
export const ZhankaiEnterAPI = id => {
  return request.get(`/park/enterprise/rent/${id}`)
}

/**
 * @description: 退租企业合同
 * @param {*} id 参数
 * @returns  promise
 */
export const TuizuenterAPI = id => {
  return request.put(`/park/enterprise/rent/${id}`)
}

/**
 * @description: 删除企业合同
 * @param {*} id 参数
 * @returns  promise
 */
export const ShanchuenterAPI = id => {
  const res = request.delete(`/park/enterprise/rent/${id}`)
  // console.log(id)
  return res
}
